package com.jack;

import java.sql.Struct;

/**
 * Created by zhang_j on 2020/9/3
 */
public class Student {

    private String name;
    private Integer age;
    private String sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public static class Builder{

        private String name;
        private Integer age;
        private String sex;
        public Builder name(String name){
            this.name = name;
            return this;
        }
        public Builder age(Integer age){
            this.age = age;
            return this;
        }
        public Builder sex(String sex){
            this.sex = sex;
            return this;
        }

        public Student build(){
            return new Student(this);
        }
    }

    public Student(){}
    public Student(Builder builder){
        this.age = builder.age;
        this.name = builder.name;
        this.sex = builder.sex;
    }
}
